package net.oschina.app;

import net.oschina.app.pages.PageCommon;
import net.oschina.app.pages.PageFavoritesList;
import net.oschina.app.pages.PageHome;
import net.oschina.app.pages.PageLogin;
import net.oschina.app.pages.PageMySettings;
import net.oschina.app.pages.PageNewsDetail;
import net.oschina.app.pages.PageSettings;

/**
 * Created by Aaron on 2017/10/29.
 */

public class Helper {
    private SoloWrap  soloWrap;
    PageCommon pageCommon;
    PageMySettings pageMySettings;
    PageLogin pageLogin;
    PageHome pageHome;
    PageNewsDetail pageNewsDetail;
    PageFavoritesList pageFavoritesList;
    PageSettings pageSettings;

    public Helper(SoloWrap soloWrap){
        this.soloWrap = soloWrap;
    }

    public PageCommon getPageCommon(){
        if (pageCommon == null){
            pageCommon = new PageCommon(soloWrap);
        }
        return pageCommon;
    }

    public PageMySettings getPageMySettings(){
        if(pageMySettings == null){
            pageMySettings = new PageMySettings(soloWrap);
        }
        return pageMySettings;
    }

    public PageLogin getPageLogin(){
        if(pageLogin == null){
            pageLogin = new PageLogin(soloWrap);
        }
        return pageLogin;
    }

    public PageHome getPageHome(){
        if(pageHome == null){
            pageHome = new PageHome(soloWrap);
        }
        return  pageHome;
    }

    public PageNewsDetail getPageNewsDetail(){
        if(pageNewsDetail == null){
            pageNewsDetail = new PageNewsDetail(soloWrap);
        }
        return pageNewsDetail;
    }

    public PageFavoritesList getPageFavoritesList(){
        if(pageFavoritesList == null){
            pageFavoritesList = new PageFavoritesList(soloWrap);
        }
        return  pageFavoritesList;
    }

    public PageSettings getPageSettings(){
        if(pageSettings == null){
            pageSettings = new PageSettings(soloWrap);
        }
        return pageSettings;
    }
}
